using System.Collections.Generic;
using System.Threading.Tasks;
using JGSY.CMS.LowCode.Platform.Domain.Entities;

namespace JGSY.CMS.LowCode.Platform.Domain.Interfaces
{
    /// <summary>
    /// 权限仓储接口
    /// 提供系统权限的数据访问操作，支持权限管理和访问控制功能
    /// </summary>
    public interface IPermissionRepository
    {
        /// <summary>
        /// 获取所有权限
        /// </summary>
        /// <returns>权限实体列表</returns>
        Task<IEnumerable<Permission>> GetAllAsync();
        
        /// <summary>
        /// 根据ID获取权限
        /// </summary>
        /// <param name="id">权限标识符</param>
        /// <returns>权限实体，如果未找到则返回null</returns>
        Task<Permission?> GetByIdAsync(long id);
        
        /// <summary>
        /// 添加新的权限
        /// </summary>
        /// <param name="entity">要添加的权限实体</param>
        /// <returns>添加操作任务</returns>
        Task AddAsync(Permission entity);
        
        /// <summary>
        /// 更新权限
        /// </summary>
        /// <param name="entity">更新后的权限实体</param>
        /// <returns>更新操作任务</returns>
        Task UpdateAsync(Permission entity);
        
        /// <summary>
        /// 删除权限
        /// </summary>
        /// <param name="id">权限标识符</param>
        /// <returns>删除操作任务</returns>
        Task DeleteAsync(long id);
    }
}
